-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Status filter checkboxes #310
Status filter checkboxes #310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall an excellent PR which works well without any errors. Just some minor issues with the modularity and the default filter overlooked.
Well done! 😀
type StatusInfo = { | ||
type: string; | ||
status: string; | ||
}; | ||
|
||
/** | ||
* Converts a status string into an info object | ||
*/ | ||
export const statusToType = (statusString: string): StatusInfo => { | ||
const [status, type] = statusString.split(' '); | ||
return { status, type }; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to include a statusToType sort of function in the filters service?
The filters service should be exclusively kept for storing and updating filters in line with the SRP.
I think this characterization of information from certain filters should be done where the filters are applied i.e., in dropdownfilter.ts in this case.
I would suggest simply using the status string in dropdownfilter.ts and parsing it appropriately as part of filtering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
export const DEFAULT_FILTER: Filter = { | ||
title: '', | ||
status: 'all', | ||
status: ['open pullrequest', 'merged pullrequest', 'closed pullrequest', 'open issue', 'closed issue'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the description of #296, closed pullrequest
should not be selected by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent changes. Just A small overlooked redundancy and naming.
Other than that, very well done PR.
export const statusToType = (statusString: string): StatusInfo => { | ||
const [status, type] = statusString.split(' '); | ||
return { status, type }; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the export necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make more sense to name the function something similar to infoFromStatus
since we are returning a type StatusInfo
object and not just a Type
which the current name seems to imply
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
The label sanitation ensures that keep filters work with labels. The method is updated to work with deselected labels as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice implementation of status filter checkboxes
Summary:
Fixes #296
Type of change:
Changes Made:
Filter::status
type fromstring
tostring[]
dropdownfilter
to filter according to the new representationFilter::type
is correctScreenshots:
Proposed Commit Message:
Checklist: